package com.example.study_thread.thread;

public class ThreadTestClass {
    public static void main(String[] args) throws InterruptedException {
        ThreadClass threadClass = new ThreadClass();
        threadClass.setName("设置ThreadClass的线程名" );
        threadClass.start();
//        threadClass.run();
//        若更改为.run()方法，则会先执行完ThreadClass中的，再执行主线程中的

        for (int i = 0; i < 50; i++) {
            Thread.sleep(1000L);
            System.out.println("主线程--->" + Thread.currentThread().getName() + "开始执行次数：" + i);
        }
    }
}
